$(function () {
    $("#getkeyword").click(function () {
        $("#memo1").fadeOut();
        $("#memo2").fadeOut();
        let url = $("#keyword")[0].value;
        if (url.length > 0) {
            window.location.href = "getall?kind=1&keyword=" + url;
            return
        }
    })
});


function DeleteData(id) {
    $.ajax({
        method: "POST",
        url: "deletedata",
        data: {
            option: "DDD",
            id: id
        },
        success: function (result) {
            console.log(result);
            if (result["error"] === undefined) {
                alert("删除成功!");
                window.location.reload()
            } else {
                alert("删除失败!" + result["error"]);
            }
        }
    })
}

function deleteall(kind) {
    $.ajax({
        method: "post",
        url: "deleteall",
        data: {
            // option: "DDD",
            kind: kind
        },
        success: function (result) {
            console.log(result);
            if (result["error"] === null) {
                alert("删除成功!");
                window.location.reload()
            } else {
                alert("删除失败!" + result["error"]);
            }
        }
    })
}
